{* Import css and javascript here *}
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/album.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/artist_detail.css" />
{*<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/comments.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/letter.css" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.THEME_RELATIVE}modules/albummodule/css/top_rate.css" />*}
<script type="text/javascript" src="{$smarty.const.THEME_RELATIVE}js/swfobject.js"></script> 
<script type="text/javascript" src="{$smarty.const.THEME_RELATIVE}modules/albummodule/album.js"></script> 

{permissions level=$smarty.const.UILEVEL_PERMISSIONS}	{if $permissions.administrate == 1}
<div align=left>
	<a class="" href="{link module=musicsmodule action=edit_musics album_id=$album->id}"  >Add new music</a>
</div>
{/if}{/permissions}


<div id="AlbumName" class="div-title-album-moi" style="float: left; ">             
      <span>{$_TR.listen}{$album->name}              
      </span>         
</div>
<div style="float: right;">
      <a href="{link action=view_page module=albummodule page=1 src=$__loc->src}" title="{$_TR.return_back}" alt="{$_TR.return_back}"><img  src="{$smarty.const.THEME_RELATIVE}modules/albummodule/images/folder_music.png" border=0></a>
    </div>
<div class="clear" style="display: block;"></div>
{if $album->show_summary ==1}
{*Begin album information*} 	     
    <div class='data'>              
      <table border='0' cellpadding='0' cellspacing='0' width="100%" {if $album->is_new ==1} style="background-image: url({$smarty.const.THEME_RELATIVE}images/new.png); background-position: top right; background-repeat: no-repeat;" {/if}>                      
        <tr>                              
          <td valign="top" width=80>                                      
            <a id="album_image_{$album->id}" class='image' href='javascript:void(0);'>                                             
              <img src={if $album->picpath != ""} "{$smarty.const.PATH_RELATIVE}phpThumb.php?src={$album->picpath}&w=100&h=120"  {else} "{$smarty.const.PATH_RELATIVE}phpThumb.php?src={$smarty.const.THEME_RELATIVE}images/album.jpg&w=115&h=115" {/if} class="image_115_llista" /></a>            </td>                              
          <td valign="top">                                  
            <div class="album_name">                                          
              <table border='0' cellpadding='0' cellspacing='0' width="100%">                                                  
                <tr>                        <td>                                                                
                    <a href='javascript:void(0);'>{$album->name}</a> -                                                                  
                    <span class="artist_name">{$album->publisher}                 		                                      
                    </span></td>
        <td align=right>
                         {*add_to_cart id=$album->id name=$album->name*}
                         &nbsp;
                        </td>
         </tr>                                                                                               
              </table>                                  
            </div>                                               
            <div class="rating">                                          
              <table cellpadding="0" cellspacing="0" width="100%">                                                  
                <tr>                                    {* Rating here *}                                                           
                  <td width="40%" align="left">                {foreach from=$album->rate item=rate}                                                                     
                    <img src='{$smarty.const.THEME_RELATIVE}images/star{$rate}.png'>                {/foreach}               </td>                                                  
                </tr>                                          
              </table>                                	                                   
            </div>                         
            <table cellpadding="0" cellspacing="1" width="99%"  class="details" >                                  
              <tr>                                          
                <td valign="top" width="33%">                                                  
                  <table cellpadding="0" cellspacing="0" width="98%" >                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.Released}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->released}</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.Format}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->format_text}</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.type}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{if $album->album_type == 0}{$_TR.type_christian}{else}{$_TR.type_other}{/if} </td>                                                          
                    </tr>                                                  
                  </table>            </td>                                          
                <td valign="top" width="33%">                                                  
                  <table cellpadding="0" cellspacing="0" width="100%">                                                         
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.length}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{duration duration=$album->length}</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.n0_disk}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->n0_disk}</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.songs}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->musics_count}</td>                                                          
                    </tr>                                                  
                  </table>            </td>                                          
                <td valign="top" width="33%">                                                  
                  <table cellpadding="0" cellspacing="0" width="100%">                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.genre}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->genre_text}</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{if $album->for_sale>0}{$_TR.price}{/if}&nbsp;</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{if $album->for_sale>0}{currency_symbol value=$album->price type=$album->currency_type}{/if}&nbsp;</td>                                                          
                    </tr>                                                          
                    <tr>                                                                  
                      <td width=35% valign="top" class="label_detailed_album">{$_TR.clicked}</td>                                                                  
                      <td width=65% valign="top" class="value_detailed_album">{$album->clicked}</td>                                                          
                    </tr>                                                  
                  </table>            </td>                                      
              </tr>                                  
            </table>                        </td>                       
        </tr>               
      </table>    
    </div> {*End of album information*} 
{/if}
{* Media player for all musics in this album *}
          {* set media player size*}
          {*if $album->media_preview ==0}
            {assign var=media_height value=0}
            {assign var=media_width value=0}
          {elseif $album->media_preview ==1}
            {assign var=media_height value=20}
            {assign var=media_width value=300}
          {elseif $album->media_preview ==2}
            {assign var=media_height value=320}
            {assign var=media_width value=400}
          {/if}
          end of set media player size
          if $plist != '' *}
          <div id="myplayer_holder" align=center name="myplayer"></div>
          <div class="media_des" >
           <span class="albummodule_button_playing" >&nbsp;&nbsp;&nbsp;&nbsp;</span>
            <span class="songname" id="songname"></span>&nbsp;-&nbsp;
            <span class="song_singer" id="song_singer"></span>
          </div>
          {*
<script type="text/javascript">
var so = new SWFObject('{$smarty.const.THEME_RELATIVE}mediaplayer.swf','myplayer','{$media_width}','{$media_height}','1');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','{$media_height}');
so.addVariable('width','{$media_width}');
so.addVariable('autostart','true');
so.addVariable('file','{$smarty.const.THEME_RELATIVE}../../tmp/playlist/{$plist}');
//so.addVariable('displaywidth','0');
so.addVariable('javascriptid','myplayer');
so.addVariable('searchbar','false');
so.addVariable('usefullscreen','true');
so.addVariable("enablejs","true");
so.addVariable("linktarget","_self");
so.write('myplayer_holder');
{literal}
// for music change
// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1) {
		return window[movieName];
	} else {
		return document[movieName];
	}
};
var current_item=0;
// this function is caught by the JavascriptView object of the player.
function sendEvent(typ,prm) { 
	if (typ == "playitem")
	{
		if (current_item == prm)
			{ sendEvent("stop"); return; }
		else
			current_item = prm;
	}
	thisMovie("myplayer").sendEvent(typ,prm); 
};
{/literal}
</script>
          {/if*} 
    {* end of media preview *}	
<div class="div-title-a-song">{$_TR.all_songs} "{$album->name}"</div>                                  
{* BEGIN OF SONG LISTS *}
<div class="padding-bottom-10px clear" id="listenAlbum"> 
    {foreach from=$album->musics item=music}       
      <div class="box-ca-khuc-cung-album-2">
        <div class="box-ca-khuc-cung-album-1-left"> 
        {if $music->high_quality !=''}
  	         {assign var="playlist_music_no" value=$playlist_music_no+1}
        {/if}                                                               
          {*<a class="link-black"  {if $music->high_quality !=''}onclick="sendEvent('playitem', {$playlist_music_no});"{/if} title="{$music->name}" href="javascript:void(0)">{$music->name}</a>    *}
          <a class="link-black"  id="ma{$music->id}" title="{$music->name}" href="javascript:void(0)">{$music->name}</a>    
          {if $music->length  != 0}             
            <span style="font-size: 10px; ">- {duration duration=$music->length}
            </span>          {/if}           {if $music->bitrate != 0}             
              <span style="font-size: 10px; ">- {$music->bitrate}kbs
              </span>          {/if}
          
          {permissions level=$smarty.const.UILEVEL_PERMISSIONS}
			     {if $permissions.administrate == 1}
				    <a href="{link module=musicsmodule action=edit_musics album_id=$album->id id=$music->id}" title="Edit this entry">
				      <img src="{$smarty.const.ICON_RELATIVE}edit.png" title="{$_TR.alt_edit}" alt="{$_TR.alt_edit}" />
			      </a>
			      <a href="{link action=delete_music id=$music->id module=musicsmodule}" title="Delete this entry">
				     <img src="{$smarty.const.ICON_RELATIVE}delete.png" title="{$_TR.alt_delete}" alt="{$_TR.alt_delete}" />
			       </a>
				    {/if}
			     {/permissions}      
        </div>                                                          
        <div class="box-ca-khuc-cung-album-1-right">                                                                  
          <div style="padding-right: 20px" class="float-left">                                                                          
            <a class="link-ovan" style="text-align:right">{$music->singer}</a>                                                                  
          </div>
          <div class="float-right">
            {if $album->downloadable == 1}                                                          {if $music->high_quality != ''}                               
				      <a class="link-ovan download_icon" style="text-align:right" href="download_file.php?id={$music->high_quality_id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
               {/if}
            {/if}
            &nbsp;
            {if $music->high_quality !='' || ($music->file_type ==1) || ($music->file_type ==2) }
	           {*<a href="javascript:sendEvent('playitem', {$playlist_music_no-1})" ><img src="{$smarty.const.THEME_RELATIVE}images/icon2.jpg"  /></a>*}
               <a href="javascript: void(0);" class="albummodule_listen" id="la{$music->id}">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
            {/if}
			{* for info view *}
			{if $music->info != '' && $music->info !='<p>&#160;</p>'}<a href="javascript:void(0);" alt="{$_TR.view_info}" title="{$_TR.view_info}" onclick='$("#music_info{$music->id}").fadeToggle("slow");'><img src="{$smarty.const.THEME_RELATIVE}modules/albummodule/images/expmode.png"  /></a>{/if}
		</div>
          <div class="clear">                     
          </div>
		 </div>                                                 
        <div class="clear">                 
        </div>                                                  
      </div>
	  {*for information of this music item*}
	  <div id="music_info{$music->id}" class="music_info">
		{$music->info}
	  </div>
	  {/foreach}
	{literal}
		<script language=javascript>
		$(document).ready(function(){
			$(".music_info").hide(); 
		});
		</script>
	  {/literal}
      <div class="clear"></div>
      <br>
      {*paging*}
		<div align=center>{paging current_page=$page pages=$pages lang_page=$_TR.page lang_first=$_TR.first lang_last=$_TR.last action=view module=albummodule id=$album->id page_length=4 src=$__loc->src}</div>
		{*paging*}
      <br>
{* BEGIN OF ALBUM INFOMATION *}
<table width=100% border=0 valign=top>
        <tr>        
          <td width=99%>                                                           
            <img src="{$smarty.const.PATH_RELATIVE}phpThumb.php?src={$album->picpath}&w=210&h=210" style="padding-right: 15px;" align=left >
            <span style="padding-left: 10px; padding-bottom: 00px; padding-top: 0px; margin-top: 0px;" class="color-black">
            <img src="{$smarty.const.THEME_RELATIVE}images/quote.gif" border=0 align=left>
            <div style="text-align: justify; font-size: 14px;">{$album->body}</div>
            </span>
          </td>
        </tr>
</table>
{* END BEGIN OF ALBUM INFOMATION *}
      <div class="clear"></div>
    </div>
{* END BEGIN OF SONG LISTS *}

{permissions level=$smarty.const.UILEVEL_PERMISSIONS}	{if $permissions.administrate == 1}						
<br><a class="" href="{link module=musicsmodule action=edit_musics album_id=$album->id}"  >Add new music</a>	{/if}{/permissions}
